-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elastic-agent install
: Only uninstall when Agent is installed
#3415
elastic-agent install
: Only uninstall when Agent is installed
#3415
Conversation
@@ -83,7 +83,7 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error { | |||
|
|||
nonInteractive, _ := cmd.Flags().GetBool("non-interactive") | |||
if nonInteractive { | |||
fmt.Fprintf(streams.Out, "Installing in non-interactive mode.") | |||
fmt.Fprintln(streams.Out, "Installing in non-interactive mode.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly related to the changes in this PR.
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
🌐 Coverage report
|
4f5f10f
to
f8a8bf1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
f8a8bf1
to
df1d988
Compare
/test |
This pull request is now in conflicts. Could you fix it? 🙏
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ycombinator could you please solve the conflicts so we can merge this ?
df1d988
to
090831e
Compare
SonarQube Quality Gate |
* Only uninstall if --force is present * Improve help text * Add missing newline * Don't pass force * Fix more conflicts * Fixing compile error introduced while resolving conflicts (cherry picked from commit 0c43005) # Conflicts: # internal/pkg/agent/install/install.go
* Only uninstall if --force is present * Improve help text * Add missing newline * Don't pass force * Fix more conflicts * Fixing compile error introduced while resolving conflicts (cherry picked from commit 0c43005) # Conflicts: # internal/pkg/agent/install/install.go
* Only uninstall if --force is present * Improve help text * Add missing newline * Don't pass force * Fix more conflicts * Fixing compile error introduced while resolving conflicts (cherry picked from commit 0c43005) # Conflicts: # internal/pkg/agent/install/install.go
…gent is installed (#3472) * `elastic-agent install`: Only uninstall when Agent is installed (#3415) * Only uninstall if --force is present * Improve help text * Add missing newline * Don't pass force * Fix more conflicts * Fixing compile error introduced while resolving conflicts (cherry picked from commit 0c43005) # Conflicts: # internal/pkg/agent/install/install.go * Addressing conflicts --------- Co-authored-by: Shaunak Kashyap <[email protected]>
What does this PR do?
This PR improves the
elastic-agent install
experience by only trying to uninstall the existing Elastic Agent installation if Elastic Agent is currently installed.Why is it important?
So the progress messages shown to the user during
elastic-agent install
are not misleading by suggesting that the existing Elastic Agent installation is being uninstalled, even when there is no Elastic Agent currently installed.Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksI have added an entry in./changelog/fragments
using the changelog toolI have added an integration test or an E2E testHow to test this PR locally
--force
flag.Related issues
Uninstalling current Elastic Agent
is shown under CLI while installing elastic-agent. #3414